package com.dunjx;

import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolver;
import entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author 敦佳星
 *
 */

@EnableDiscoveryClient

@EnableEurekaClient
@SpringBootApplication
@EnableFeignClients(basePackages = {"com.dunjx.fast.feign"})
@MapperScan("com.dunjx.user.dao")
public class UserApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }

    @Bean
    public BCryptPasswordEncoder bCryptPasswordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean
    public IdWorker idWorker() {
        return new IdWorker(0, 1);
    }


}
